#include<stdio.h>
#include<stdlib.h>

int main()
{
	int size, i, j, yanghuiNum = 1;
	printf("Plaese input the size of Yanghui triangle:>");
	scanf("%d", &size);
	
	for(i = 0; i < size; i++)
	{
		for(j = 0; j <= i; j++)
		{
			if(j == 0 || j == i|| i == 0)
			{
				yanghuiNum = 1;
			}
			else
			{
				yanghuiNum = yanghuiNum * (i - j + 1) / j;
			}
			printf("%3d ", yanghuiNum);
		}
		
		printf("\n");
	}
	
	return 0;
} 
